<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>CSS把正方形变成圆形</title>
</head>
<body>
  <h1>长宽为400px的正方形</h1>
  <div class="my-square"></div>

  <h1>border-radius为100px</h1>
  <div id="square0" class="my-square"></div>

  <h1>border-radius为200px(400的一半)</h1>
  <div id="square1" class="my-square"></div>

  <h1>border-radius为300px(超过400的一半)</h1>
  <div id="square2" class="my-square"></div>

  <h1>border-radius为50%</h1>
  <div id="square3" class="my-square"></div>

  <h1>border-radius为100%</h1>
  <div id="square4" class="my-square"></div>
</body>
<style>
  h1 {
    text-align: center;
  }

  div {
    margin: auto;
  }

  .my-square {
    height: 400px;
    width: 400px;
    background-color: aqua;
  }

  
  #square0 {
    border-radius: 100px;
    background-color: aquamarine;
  }

  #square1 {
    border-radius: 200px;
    background-color: rgb(127, 225, 255);
  }

  #square2 {
    border-radius: 300px;
    background-color: rgb(127, 136, 255);
  }

  #square3 {
    border-radius: 50%;
    background-color: rgb(155, 127, 255);
  }

  #square4 {
    border-radius: 100%;
    background-color: rgb(227, 255, 127);
  }
  
</style>
</html>